<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>Document</title>
    <style type="text/css">
        .parent{
            width: 80%;
            height: 100px;
            background-color: aliceblue;
            display: flex;
            margin: 0 auto;
        }

        .parent div:nth-child(1){
            width: 100px;
            height: 100px;
            background-color: bisque;
        }
        .parent div:nth-child(2){
            /*flex 1，表示分配剩余空间,这个子元素分配1份，由于只有一个子元素设置了flex属性，所以剩余空间只分割了一份，所以他占了全部剩余空间*/
            flex: 1;
            width: 100px;
            height: 100px;
            background-color: greenyellow;
        }
        .parent div:nth-child(3){
            width: 100px;
            height: 100px;
            background-color: cornflowerblue;
        }
    </style>
</head>

<body>
    <div class="parent">
        <div>1</div>
        <div>2</div>
        <div>3</div>
    </div>
</body>
</html>